package com.fengmi.mapper;

import com.fengmi.entity.MallGoodsSpec;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 作者：陈学虎
 * 时间：2021/7/8 0008 下午 7:20
 */
@Mapper
public interface MallGoodsSpecMapper {

    int save(MallGoodsSpec spec);

    //查一个
    @Select("select * from mall_goods_spec where spec_name = #{specName} ")
    MallGoodsSpec findBySpecName(String specName);

    //删除根据id
    @Delete("delete from mall_goods_spec where id = #{id} ")
    int delById(int id);

    //查所有的规格信息
    @Select("select * from mall_goods_spec")
    List<MallGoodsSpec> findAllSpec();
}
